package com.ruoyi.basedata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 小表档案数据视图对象 v_t_terminals_xb_view
 *
 * @author gdqt
 * @date 2024-03-19
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("v_t_terminals_xb_view")
public class TerminalsXbView implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 设备归属水司
     */
    @Excel(name = "设备归属水司")
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
    @TableField("terminal_id")
    private String terminalId;

    @Excel(name = "设备编号")
    @TableField("location_nb")
    private String locationNb;

    /**
     * 区域编号
     */
    @Excel(name = "区域编号")
    @TableField("sheets_code")
    private String sheetsCode;

    /**
     * 区域名称
     */
    @TableField(exist = false)
    private String sheetsName;

    /**
     * 用户编号
     */
    @Excel(name = "用户编号")
    @TableField("user_id")
    private String userId;

    /**
     * 厂家编号
     */
    @Excel(name = "厂家编号")
    @TableField("supplier_id")
    private String supplierId;

    /**
     * 集中器id
     */
    @Excel(name = "集中器id")
    @TableField("concentrator_id")
    private Long concentratorId;

    /**
     * 采集器id
     */
    @Excel(name = "采集器id")
    @TableField("collector_id")
    private Long collectorId;

    /**
     * 表型号id
     */
    @Excel(name = "表型号id")
    @TableField("type_id")
    private String typeId;

    /**
     * 表底数
     */
    @Excel(name = "表底数")
    @TableField("base_reading")
    private BigDecimal baseReading;

    /**
     * 协议id
     */
    @Excel(name = "协议id")
    @TableField("protocol_id")
    private String protocolId;

    /**
     * 是否带阀控(0：否，1：是)
     */
    @Excel(name = "是否带阀控(0：否，1：是)")
    @TableField("valve_control")
    private Long valveControl;

    /**
     * 阀门地址
     */
    @Excel(name = "阀门地址")
    @TableField("valve_address")
    private String valveAddress;

    /**
     * 启用日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "启用日期", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("install_date")
    private Date installDate;

    /**
     * 门牌号
     */
    @Excel(name = "门牌号")
    @TableField("install_address")
    private String installAddress;

    /**
     * 换表标志(0：否，1：是)
     */
    @Excel(name = "换表标志(0：否，1：是)")
    @TableField("change_mark")
    private Long changeMark;

    /**
     * 新表编号
     */
    @Excel(name = "新表编号")
    @TableField("terminal_new")
    private String terminalNew;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField("del_flag")
    private Long delFlag;

    /**
     * 抄表周期(单位小时)
     */
    @Excel(name = "抄表周期(单位小时)")
    @TableField("meter_reader_cycle")
    private Long meterReaderCycle;

    /**
     * 表状态（0-停用, 1-使用）
     */
    @Excel(name = "表状态", readConverterExp = "0=-停用,,1=-使用")
    @TableField("terminal_mark")
    private Integer terminalMark;

    /**
     * 表解析地址
     */
    @Excel(name = "表解析地址")
    @TableField("communicate_address")
    private String communicateAddress;

    /**
     * 计量版电压类型
     */
    @Excel(name = "计量版电压类型")
    @TableField("voltage_type")
    private String voltageType;

    /**
     * 计量版电压
     */
    @Excel(name = "计量版电压")
    @TableField("metered_voltage")
    private BigDecimal meteredVoltage;

    @TableField("terminal_csq")
    private BigDecimal terminalCsq;

    /**
     * 瞬时流量计算方式
     */
    @Excel(name = "瞬时流量计算方式")
    @TableField("instantaneous_js_fs")
    private String instantaneousJsFs;

    /**
     * aep平台的唯一码
     */
    @Excel(name = "aep平台的唯一码")
    @TableField("device_id")
    private String deviceId;

    /**
     * imei
     */
    @Excel(name = "imei")
    @TableField("imei")
    private String imei;

    /**
     * 用户名称
     */
    @Excel(name = "用户名称")
    @TableField("user_name")
    private String userName;

    /**
     * 用户通讯地址
     */
    @Excel(name = "用户通讯地址")
    @TableField("user_address")
    private String userAddress;

    /**
     * 水表读数
     */
    @Excel(name = "水表读数")
    @TableField("total_flow")
    private BigDecimal totalFlow;

    /**
     * 抄表时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "抄表时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("read_date")
    private Date readDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    /**
     * 预警描述
     */
    @TableField("description")
    private String description;

    /**
     * 是否带阀控
     */
    @TableField("valve_state")
    private Integer valveState;

    /**
     * 样表图片
     */
    @TableField(exist = false)
    private String sampleTableImage;


    /**
     * 采集器地址
     */
    @TableField("collector_address")
    private String collectorAddress;


    /**
     * 集中器地址
     */
    @TableField("concentrator_address")
    private String concentratorAddress;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("tenantId", getTenantId())
                .append("terminalId", getTerminalId())
                .append("sheetsCode", getSheetsCode())
                .append("userId", getUserId())
                .append("supplierId", getSupplierId())
                .append("concentratorId", getConcentratorId())
                .append("collectorId", getCollectorId())
                .append("typeId", getTypeId())
                .append("baseReading", getBaseReading())
                .append("protocolId", getProtocolId())
                .append("valveControl", getValveControl())
                .append("valveAddress", getValveAddress())
                .append("installDate", getInstallDate())
                .append("installAddress", getInstallAddress())
                .append("changeMark", getChangeMark())
                .append("terminalNew", getTerminalNew())
                .append("delFlag", getDelFlag())
                .append("meterReaderCycle", getMeterReaderCycle())
                .append("terminalMark", getTerminalMark())
                .append("communicateAddress", getCommunicateAddress())
                .append("voltageType", getVoltageType())
                .append("meteredVoltage", getMeteredVoltage())
                .append("instantaneousJsFs", getInstantaneousJsFs())
                .append("deviceId", getDeviceId())
                .append("imei", getImei())
                .append("userName", getUserName())
                .append("userAddress", getUserAddress())
                .append("totalFlow", getTotalFlow())
                .append("readDate", getReadDate())
                .append("collectorAddress", getCollectorAddress())
                .append("concentratorAddress", getConcentratorAddress())
                .toString();
    }
}
